    {layout name='./base'}
    <div class="row">
      <div class="col-lg-12">
        <h1></h1>
        <h3 class="alert alert-success">文本消息</h3>
      </div>
    </div>
    <div class="">
    	<a href="/textmsg/create" class="btn btn-success">添加文本消息</a>
    </div>
	<table class="table table-hover">
		<thead>
			<tr>
				<th>编号</th>
				<th>关键字</th>
				<th>内容</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{foreach $list as $v}
			<tr>
				<td>{$v.id}</td>
				<td>{$v.keyword}</td>
				<td>{$v.content}</td>
				<td><a href="/textmsg/{$v.id}/edit">编辑</a> | <a href="javaScript:;" num="{$v.id}" class="del">删除</a></td>
			</tr>
			{/foreach}
		</tbody>
	</table>
	<script type="text/javascript">
		$('.del').click(function(){
			if(confirm('确定要删除吗')){
				var _this = $(this);
				var id = _this.attr('num');
				$.ajax({
					type:"delete",
					url:"/textmsg/"+id+'?'+Math.random(),
					dataType: 'json',
					success: function(data){
						if(data===1){
							_this.parents('tr').hide();
						}
					}
				});
			}
		})
	</script>